<template>
	<view>
		<!-- //标题 -->
		<view class="top-box tn-cool-bg-color-15--reverse">
			<view class="text-xl text-red margin-left-lg text-bold tn-cool-bg-color-15--reverse padding-xs">{{ timeGet }}</view>
			<view class="text-lg text-bold">分区统计</view>
			<view class="text-lg margin-right-sm text-bold tn-cool-bg-color-15--reverse padding-xs" style="border-radius: 10rpx;"
				@click="shuaxin">刷新</view>
		</view>
		<view class="menu-list" style="margin-top: 30px;">
			<block v-for="(item,index) in menuList" :key="index">
				<view class="menu-tem" @click="itemClickHandle(index)">
					<u-icon :name="item.icon" color="#ff0000" size="70"></u-icon>
					<text class="menu-item-text">{{item.name}}</text>
					<view class="menu-item-text">共计：{{orderData[index].count}}</view>
					<view class="menu-item-text">未送：{{orderData[index].ws_storenum}}</view>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderData:[],
				menuList: [{
					icon: 'home-fill',
					name: '后湖一分区',
					url: "/pages/manage/manageQs/manageArea/outQsTimeDetailArea?time=2"
				}, {
					icon: 'home-fill',
					name: '后湖二分区',
					url: "/pages/manage/manageQs/OutQs/OutQs?place=1"
				}, {
					icon: 'home-fill',
					name: '后湖三分区',
					url: "/pages/manage/manageQs/OutQs/OutQs?place=1"
				},
				{
					icon: 'home-fill',
					name: '后湖四分区',
					url: "/pages/manage/manageQs/OutQs/OutQs?place=1"
				}
				]
			}
		},
		onLoad(options) {
			this.timeGet = options.timeGet
			this.school = Number(options.oSchool) 
			this.place = options.place
		},
		onShow() {
			this.init()
		},
		methods: {
			itemClickHandle(index) {
				var area= index+1
				var url = '/pages/manage/manageQs/manageArea/outQsTimeDetailArea/outQsTimeDetailArea?area='+area+'&timeGive='+this.timeGet+"&oSchool="+this.school+"&place="+this.place 
				uni.navigateTo({
					url: url
				})
			},
			//开始加载
			init() {
				let that = this;
				uni.request({
					url:"https://zback.shixiaozhu.work/ShixiaozhuTest/order/getAreaInfo?area=1"+"&givetime="+this.timeGet+"&oSchool="+that.school+"&place="+this.place ,
					success(res) {
						that.orderData = res.data.data
					}
				})
			},
			shuaxin() {
				this.orderData = []
				this.init();
			}
		}
	}
</script>

<style>
	.top-box {
		width: 100%;
		height: 100rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.menu-list {
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		width: 100vw;
		height: 100vw;
		flex-wrap: wrap;
	}

	.menu-tem {
		box-sizing: border-box;
		flex: 0 0 33.33%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		height: 192rpx;
		border: 2px solid #000000;
	}

	.menu-item-text {
		font-size: 26rpx;
		margin-top: 10rpx;
		color: #333;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
</style>
